package JJJJJJava.loadandsave;

import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.sql.DataFrame;
import org.apache.spark.sql.SQLContext;

/**
 * @Auther: Mengkunxuan
 * @Date:2018/9/2611:11
 * @Description:
 */
public class ManuallySpecifyOptions {
    public static void main(String[] args) {
        SparkConf conf  = new SparkConf().setMaster("local").setAppName("ManuallySpecifyOptions");
        JavaSparkContext sc = new JavaSparkContext(conf);
        SQLContext sqlContext = new SQLContext(sc);
        DataFrame  peopleDF= sqlContext.read().format("json").load("c:/");
        peopleDF.select("name").write().format("parquet").save("c:/");
    }
}
